package com.gblfy.qywxin.config;

/**
 * 企业微信常量配置类
 *
 * @author gblfy
 * @date 2022-01-12
 */
public class QywxInnerConfig {

    public static final String BASE_URL = "https://qyapi.weixin.qq.com/cgi-bin/";

    //获取access_token
    //https://open.work.weixin.qq.com/api/doc/90000/90135/91039
    public static final String ACCESS_TOKEN_URL = BASE_URL + "gettoken?corpid=%s&corpsecret=%s";

    // H5应用
    //scope	是	应用授权作用域。企业自建应用固定填写：snsapi_base
    // https://open.work.weixin.qq.com/api/doc/90000/90135/91020
    public static final String OAUTH_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect";
    //https://open.work.weixin.qq.com/api/doc/90000/90135/91023
    public static final String OAUTH_USER_URL = BASE_URL + "user/getuserinfo?access_token=%s&code=%s";


    //公司相关
    //https://open.work.weixin.qq.com/api/doc/90000/90135/90196
    public static final String USER_DETAIL_URL = BASE_URL + "user/get?access_token=%s&userid=%s";


    //    -----------------------------------------------小程序信息----------------------------------------------------
    //获取access_token 和H5获取token同一个api
    //https://open.work.weixin.qq.com/api/doc/90000/90135/91039
    public static final String MINI_ACCESS_TOKEN_URL = BASE_URL + "gettoken?corpid=%s&corpsecret=%s";
    //https://developer.work.weixin.qq.com/document/path/91507
    public static final String MINI_OAUTH_USER_URL = BASE_URL + "miniprogram/jscode2session?access_token=%s&js_code=%s&grant_type=authorization_code";
}
